<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="sf" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" href="<%=request.getContextPath() %>/resources/css/admin/basic.css" type="text/css"/>
<link rel="stylesheet" href="<%=request.getContextPath() %>/resources/css/admin/index.css" type="text/css"/>
<link rel="stylesheet" href="<%=request.getContextPath() %>/resources/css/admin/table1.css" type="text/css"/>
<link rel="stylesheet" href="<%=request.getContextPath() %>/resources/css/icon.css" type="text/css"/>
<script type="text/javascript" src="<%=request.getContextPath()%>/resources/js/jquery-1.8.3.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/resources/js/main.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/resources/js/admin/jquery.admintable.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath()%>/resources/js/public/jquery.confirmdialog.js"></script>
    <script type="text/javascript">
$(function(){
	$("#admintable").admintable();
    $("a[oper='delete']").confirmdialog();

});
function doExport(){


    document.getElementById("mainForm").submit();
}
function display(){
    document.getElementById("mainForm").action="<%=request.getContextPath() %>/admin/goods/search";
    document.getElementById("mainForm").submit();
}
</script>
</head>
<body>
<div class="main_content_container">
    <form method="post" id="mainForm">
	<table id="admintable" cellpadding="0" cellspacing="0">
        <thead>
        <tr>
            <td  colspan="10" class="title">
                <ul class="function_menu">
                    <li id="select"> <input name="name" size="30"/> </li>
                    <li><a href="#" onclick="display()"><span class="icon16 icon-search"></span>查询</a></li>
                    <li><a href="#" onclick="doExport()" oper="delete" ><span class="icon16 icon-cancel"></span>删除</a></li>
                </ul>
            </td>
        </tr>
        <tr showCheck="1">
            <td objId="1" width="5%" align="center"><strong>编号</strong></td>
            <td width="100px"  align="center"><strong>图片</strong></td>
            <td  align="center"><strong>名称</strong></td>
            <td  align="center"><strong>品牌</strong></td>
            <td  align="center"><strong>价格</strong></td>
            <td  align="center"><strong>库存</strong></td>
            <td  align="center"><strong>上架时间</strong></td>
            <td  align="center"><strong>状态：  <a class="list_link" href="<%=request.getContextPath() %>/admin/sellGoodList">正售</a>/  <a class="list_link" href="<%=request.getContextPath() %>/admin/unSellGoodList">待审核</a></strong></td>
            <td  align="center"><strong>操作</strong></td>
        </tr>
        </thead>

	<tbody>


    <c:forEach items="${goodsList.datas }" var="goods">
        <tr>
            <td objId="${goods.id}" align="center">${goods.id}</td>
            <td align="center"><image src="<%=request.getContextPath()%>/resources/images/goodsImages/${goods.image}" height="100px" width="100px"/></td>
            <td align="center"><a href="<%=request.getContextPath() %>/admin/goodsDetail/${goods.id }" class="list_link">${goods.name}</a></td>
            <td align="center">
                <a class="list_link"  >${goods.brand}</a>
                &nbsp;
            </td>
            <td align="center">
              ${goods.price}
                &nbsp;
            </td>
            <td align="center">
                    ${goods.stock}
                &nbsp;
            </td>
            <td align="center">
                    ${goods.uptime}
                &nbsp;
            </td>

            <td  class="jianju10" align="center">
                <c:if test="${goods.status eq 0 }">
                    <span class="emp">待审核</span>
                    <a href="<%=request.getContextPath() %>/admin/goods/updateStatus/${goods.id }" class="list_op">上架</a>
                </c:if>
                <c:if test="${goods.status eq 1 }">
                    <span>正出售</span>
                    <a href="<%=request.getContextPath() %>/admin/goods/updateStatus/${goods.id }" class="list_op">下架</a>
                </c:if>
                &nbsp;
            </td>
            <td align="center">

                <c:if test="${goods.status eq 0 }">

                    <a href="<%=request.getContextPath() %>/admin/goods/updateUnPassStatus/${goods.id }" class="list_op">未通过</a>
                </c:if>
                <c:if test="${goods.status eq 1 }">

                    <a href="<%=request.getContextPath() %>/admin/goods/delete/${goods.id }" class="list_op">删除</a>
                </c:if>
                &nbsp;
            </td>

        </tr>
    </c:forEach>


	  	</tbody>

	  	<tfoot>
	  	<tr>
		    <td colspan="10">
                <jsp:include page="/jsp/public/pager.jsp">
                    <jsp:param value="${goodsList.total }" name="totalRecord"/>
                    <jsp:param value="goodsList" name="url"/>
                </jsp:include>
		    </td>
	    </tr>
	    </tfoot>

	</table>
    </form>
   </div>
</div>
</body>
</html>